<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
  </head>

  <body>
    <div id="app">
      <!-- lazy ,主动按下回车，或者input失去焦点才会触发v-model-->
      <input type="text" name="" id="" v-model.lazy="msg" />
      {{msg}}
      <!-- number，控制输入的内容为number类型 -->
      <input type="number" v-model.number="age">
      {{typeof age}}
      <br>
      <!-- trim 去除输入内容中两端的空格 -->
      <input type="text" v-model.trim="context">
      <br>
      输入的内容：{{context}}
    </div>
    <script>
      var vm = new Vue({
        el: "#app",
        data: {
          msg: "",
          age:"",
          context:""

        },
        methods: {},
      });
    </script>
  </body>
</html>
